/*!
 * PhotoSphereViewer.GalleryPlugin 5.4.4
 * @copyright 2023 Damien "Mistic" Sorel
 * @licence MIT (https://opensource.org/licenses/MIT)
 */

// *** MAIN ***
$psv-main-background-stops: #fff 0%,
    #fdfdfd 16%,
    #fbfbfb 33%,
    #f8f8f8 49%,
    #efefef 66%,
    #dfdfdf 82%,
    #bfbfbf 100% !default;
$psv-main-background: radial-gradient($psv-main-background-stops) !default;
$psv-element-focus-outline: 2px solid #007cff !default;

// *** LOADER ***
$psv-loader-bg-color: rgba(61, 61, 61, 0.5) !default;
$psv-loader-color: rgba(255, 255, 255, 0.7) !default;
$psv-loader-width: 150px !default;
$psv-loader-tickness: 10px !default;
$psv-loader-border: 3px !default;
$psv-loader-font: 600 16px sans-serif !default;

// *** NAVBAR ***
$psv-navbar-height: 40px !default;
$psv-navbar-background: rgba(61, 61, 61, 0.5) !default;

$psv-caption-font: 16px sans-serif !default;
$psv-caption-text-color: rgba(255, 255, 255, 0.7) !default;

$psv-buttons-height: 20px !default;
$psv-buttons-padding: (($psv-navbar-height - $psv-buttons-height) * 0.5) !default;
$psv-buttons-background: transparent !default;
$psv-buttons-active-background: rgba(255, 255, 255, 0.2) !default;
$psv-buttons-color: rgba(255, 255, 255, 0.7) !default;
$psv-buttons-disabled-opacity: 0.5 !default;

$psv-buttons-hover-scale: 1.2 !default;
$psv-buttons-hover-scale-delay: 200ms !default;

$psv-zoom-range-width: 80px !default;
$psv-zoom-range-tickness: 1px !default;
$psv-zoom-range-diameter: 7px !default;
$psv-zoom-range-media-min-width: 600px !default;

// *** TOOLTIP ***
$psv-tooltip-background: rgba(61, 61, 61, 0.8) !default;
$psv-tooltip-animate-offset: 5px !default;
$psv-tooltip-animate-delay: 100ms !default;
$psv-tooltip-radius: 4px !default;
$psv-tooltip-padding: 0.5em 1em !default;
$psv-tooltip-arrow-size: 7px !default;
$psv-tooltip-max-width: 200px !default;

$psv-tooltip-text-color: rgb(255, 255, 255) !default;
$psv-tooltip-font: 14px sans-serif !default;
$psv-tooltip-text-shadow: 0 1px #000 !default;

$psv-tooltip-shadow-color: rgba(90, 90, 90, 0.7) !default;
$psv-tooltip-shadow-offset: 3px !default; // the shadow is always at the opposite side of the arrow

// *** PANEL ***
$psv-panel-background: rgba(10, 10, 10, 0.7) !default;
$psv-panel-text-color: rgb(220, 220, 220) !default;
$psv-panel-font: 16px sans-serif !default;
$psv-panel-width: 400px !default;
$psv-panel-padding: 1em !default;
$psv-panel-animate-delay: 100ms !default;

$psv-panel-resizer-width: 9px !default; // must be odd
$psv-panel-resizer-background: rgba(0, 0, 0, 0.9) !default;
$psv-panel-resizer-grip-color: #fff !default;
$psv-panel-resizer-grip-height: 29px !default; // must be odd
$psv-panel-close-button-size: 32px !default;
$psv-panel-close-button-background: $psv-panel-resizer-background !default;
$psv-panel-close-button-color: #fff !default;
$psv-panel-close-button-animate-delay: 300ms !default;

$psv-panel-title-font: 24px sans-serif !default;
$psv-panel-title-icon-size: 24px !default;
$psv-panel-title-margin: 24px !default;

$psv-panel-menu-item-height: 1.5em !default;
$psv-panel-menu-item-padding: 0.5em 1em !default;
$psv-panel-menu-item-active-outline: 1px !default;
$psv-panel-menu-odd-background: rgba(255, 255, 255, 0.1) !default;
$psv-panel-menu-even-background: transparent !default;
$psv-panel-menu-hover-background: rgba(255, 255, 255, 0.2) !default;

// *** NOTIFICATION ***
$psv-notification-position-from: -$psv-navbar-height !default;
$psv-notification-position-to: $psv-navbar-height * 2 !default;
$psv-notification-animate-delay: 200ms !default;
$psv-notification-background: $psv-tooltip-background !default;
$psv-notification-radius: $psv-tooltip-radius !default;
$psv-notification-padding: $psv-tooltip-padding !default;
$psv-notification-font: $psv-tooltip-font !default;
$psv-notification-text-color: $psv-tooltip-text-color !default;

// *** OVERLAY ***
$psv-overlay-opacity: 0.8 !default;
$psv-overlay-title-font: 30px sans-serif !default;
$psv-overlay-title-color: black !default;
$psv-overlay-text-font: 20px sans-serif !default;
$psv-overlay-text-color: rgba(0, 0, 0, 0.8) !default;
$psv-overlay-image-size: (
    portrait: 50vw,
    landscape: 25vw,
) !default;

// *** Z-INDEXES ***
$psv-canvas-zindex: 0 !default;
$psv-hud-zindex: 10 !default;
$psv-polygon-marker-zindex: 20 !default;
$psv-marker-zindex: 30 !default;
$psv-compass-zindex: 40 !default;
$psv-tooltip-zindex: 50 !default;
$psv-loader-zindex: 80 !default;
$psv-panel-zindex: 90 !default;
$psv-navbar-zindex: 90 !default;
$psv-notification-zindex: 100 !default;
$psv-overlay-zindex: 110 !default;


$psv-gallery-padding: 15px !default;
$psv-gallery-border: 1px solid $psv-caption-text-color !default;
$psv-gallery-background: $psv-navbar-background !default;
$psv-gallery-item-radius: 5px !default;
$psv-gallery-item-active-border: 3px solid white !default;
$psv-gallery-title-font: $psv-caption-font !default;
$psv-gallery-title-color: $psv-caption-text-color !default;
$psv-gallery-title-background: rgba(0, 0, 0, 0.6) !default;
$psv-gallery-thumb-hover-scale: 1.2 !default;
$psv-gallery-breakpoint: 500px !default;

.psv-container {
    --psv-gallery-plugin-loaded: true;
}

.psv-gallery {
    --psv-gallery-breakpoint: #{$psv-gallery-breakpoint};

    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    background: $psv-gallery-background;
    border-bottom: $psv-gallery-border;
    overflow: hidden;
    transition: transform ease-in-out 0.1s;
    transform: translateY(100%);
    z-index: $psv-navbar-zindex;
    cursor: default;

    @at-root .psv--has-navbar & {
        bottom: $psv-navbar-height;
        transform: translateY(calc(100% + #{$psv-navbar-height}));
    }

    &--open {
        transform: translateY(0) !important;
    }

    &-container {
        display: flex;
        align-content: flex-start;
        padding: $psv-gallery-padding;
        overflow-x: auto;
    }

    &-item {
        flex: none;
        position: relative;
        border-radius: $psv-gallery-item-radius;
        overflow: hidden;
        cursor: pointer;

        &:not(:last-child) {
            margin-right: $psv-gallery-padding;
        }

        &-title {
            position: absolute;
            top: 0;
            left: 0;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            box-sizing: border-box;
            width: 100%;
            height: 2.2em;
            padding: 0.5em;
            background: $psv-gallery-title-background;
            font: $psv-gallery-title-font;
            line-height: 1.2em;
            color: $psv-gallery-title-color;
            z-index: 2;
            transition: height ease-in-out 0.2s;

            span {
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
                user-select: none;
            }
        }

        &-thumb {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-position: center center;
            background-size: cover;
            transform: scale3d(1, 1, 1);
            transition: transform ease-in-out 0.2s;
            z-index: 1;
        }

        &:hover &-title {
            height: 100%;

            span {
                white-space: normal;
            }
        }

        &:hover &-thumb {
            transform: scale3d($psv-gallery-thumb-hover-scale, $psv-gallery-thumb-hover-scale, 1);
        }

        &--active::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            box-sizing: border-box;
            border: $psv-gallery-item-active-border;
            z-index: 3;
        }
    }

    @media screen and (width <= #{$psv-gallery-breakpoint}) {
        top: 0;

        &-container {
            flex-wrap: wrap;
            height: calc(100% - #{$psv-panel-close-button-size});
            margin-top: $psv-panel-close-button-size;
            padding: 0 0 0 $psv-gallery-padding;
            overflow-x: hidden;
            overflow-y: auto;
        }

        &-item {
            width: calc(50% - #{$psv-gallery-padding}) !important;
            margin-bottom: $psv-gallery-padding;
        }

        .psv-panel-close-button {
            display: block;
            z-index: 10;
        }
    }
}
